package com.wlyuan.open.scanner.utils.enums.named;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @description
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum SplitTypeEnum implements NamedValue<Integer> {

    LINE_SPLIT(1, 1, "线路拆单"),
    QUANTITY_SPLIT(2, 2, "数量拆单");

    private final Integer value;
    private final Integer newValue;
    private final String name;

    private static final Map<Integer, SplitTypeEnum> MAP = new NamedValueMap<>(SplitTypeEnum.class);

    public static SplitTypeEnum fromValue(Integer value) {
        return MAP.get(value);
    }
}
